function T = dynamic_resid_tt(T, y, x, params, steady_state, it_)
% function T = dynamic_resid_tt(T, y, x, params, steady_state, it_)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T             [#temp variables by 1]     double  vector of temporary terms to be filled by function
%   y             [#dynamic variables by 1]  double  vector of endogenous variables in the order stored
%                                                    in M_.lead_lag_incidence; see the Manual
%   x             [nperiods by M_.exo_nbr]   double  matrix of exogenous variables (in declaration order)
%                                                    for all simulation periods
%   steady_state  [M_.endo_nbr by 1]         double  vector of steady state values
%   params        [M_.param_nbr by 1]        double  vector of parameter values in declaration order
%   it_           scalar                     double  time period for exogenous variables for which
%                                                    to evaluate the model
%
% Output:
%   T           [#temp variables by 1]       double  vector of temporary terms
%

assert(length(T) >= 37);

T(1) = params(23)*(y(36)*y(21))^(1-params(1));
T(2) = (y(30)*y(4))^params(1);
T(3) = (1-params(6))/params(6);
T(4) = y(11)^params(6);
T(5) = (1-y(21))^(1-params(6));
T(6) = (1-params(9))/params(12);
T(7) = 1/params(12);
T(8) = params(24)*(y(10)*T(4)*T(5))^T(6)+params(2)*y(17)^T(7);
T(9) = params(12)/(1-params(9));
T(10) = params(8)/2;
T(11) = 1-y(13)-T(10)*(y(18)/y(4)-params(3))^2;
T(12) = y(10)/y(1);
T(13) = T(12)*T(4)*T(5);
T(14) = y(2)^params(6);
T(15) = (1-y(5))^(1-params(6));
T(16) = T(14)*T(15);
T(17) = T(13)/T(16);
T(18) = params(2)*T(17)^T(6);
T(19) = y(2)/y(11);
T(20) = y(32)^(1-params(9));
T(21) = T(20)/y(3);
T(22) = T(21)^(1-T(7));
T(23) = y(44)^(-1);
T(24) = y(47)*y(26)*T(23);
T(25) = y(23)/params(38);
T(26) = y(35)/y(8);
T(27) = params(7)/2*(T(25)-1)^2;
T(28) = y(42)/y(19);
T(29) = 1-y(41)-T(10)*(T(28)-params(3))^2+T(28)*params(8)*(T(28)-params(3));
T(30) = y(47)*(y(48)*y(46)+y(45)*T(29));
T(31) = T(25)*params(7)*(T(25)-1);
T(32) = y(44)/params(38);
T(33) = y(50)/y(35);
T(34) = y(47)*params(7)*(T(32)-1)*T(33);
T(35) = 1-params(13)+params(13)/y(20)+T(32)*T(34);
T(36) = (y(40)+y(43))^2;
T(37) = y(22)^2;

end
